
/*--------------------------------------------------------------
s_axis_tuser:
[71:56]---rx_pkg_id
[55:24]---rx_ip_source_ip
[23:16]---rx_pkg_type
[15:0]---rx_ip_data_len


m_axis_tuser:
[55:24]---tx_ip_target_ip
[23:16]---tx_pkg_type  icmp=1
[15:0]---tx_ip_data_len
--------------------------------------------------------------*/


module ethernet_icmp_top(
    input                       i_clk                               ,
    input                       i_rst                               ,
    input                       s_axis_tvalid                       ,
    input   [7 : 0]             s_axis_tdata                        ,
    input                       s_axis_tlast                        ,
    input   [71: 0]             s_axis_tuser                        ,
    output                      m_axis_tvalid                       ,
    output  [7 : 0]             m_axis_tdata                        ,
    input                       m_axis_tready                       ,
    output                      m_axis_tlast                        ,
    output  [55: 0]             m_axis_tuser                         
);

    logic                       icmp_user_rx_axis_tvalid            ;
    logic   [7 : 0]             icmp_user_rx_axis_tdata             ;
    logic                       icmp_user_rx_axis_tlast             ;
    logic   [79: 0]             icmp_user_rx_axis_tuser             ; 

    // ila128_bit ila128_bit_icmp(
    //     .clk    ( i_clk),
    //     .probe0 ( {s_axis_tvalid,s_axis_tdata,s_axis_tlast,s_axis_tuser[47:16],
    //     m_axis_tvalid,m_axis_tdata,m_axis_tready,m_axis_tlast,m_axis_tuser
    //     })
    // );      
    
    icmp_rx icmp_rx_inst0(
        .i_clk                  ( i_clk                             ),
        .i_rst                  ( i_rst                             ),
        .s_axis_tvalid          ( s_axis_tvalid                     ),  
        .s_axis_tdata           ( s_axis_tdata                      ),  
        .s_axis_tlast           ( s_axis_tlast                      ),  
        .s_axis_tuser           ( s_axis_tuser                      ),  
        .m_axis_tvalid          ( icmp_user_rx_axis_tvalid          ),  
        .m_axis_tdata           ( icmp_user_rx_axis_tdata           ),  
        .m_axis_tlast           ( icmp_user_rx_axis_tlast           ),  
        .m_axis_tuser           ( icmp_user_rx_axis_tuser           )
    );

    icmp_tx icmp_tx_inst0( 
        .i_clk                  ( i_clk                             ),
        .i_rst                  ( i_rst                             ),
        .s_axis_tvalid          ( icmp_user_rx_axis_tvalid          ),
        .s_axis_tdata           ( icmp_user_rx_axis_tdata           ),
        .s_axis_tlast           ( icmp_user_rx_axis_tlast           ),
        .s_axis_tuser           ( icmp_user_rx_axis_tuser           ),
        .m_axis_tvalid          ( m_axis_tvalid                     ),
        .m_axis_tdata           ( m_axis_tdata                      ),
        .m_axis_tready          ( m_axis_tready                     ),
        .m_axis_tlast           ( m_axis_tlast                      ),
        .m_axis_tuser           ( m_axis_tuser                      )
    );



endmodule
